package com.wsjzzcbq.qianyuan.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * JobStatus 任务状态
 *
 * @author wsjz
 * @date 2022/03/22
 */
@Getter
@AllArgsConstructor
public enum JobStateEnum {

    RUNNING("运行中", 1),

    PAUSED("已停止", 0);

    private String name;

    private Integer value;

    public static String getNameByValue(Integer value) {
        for (JobStateEnum state : JobStateEnum.values()) {
            if (state.value.equals(value)) {
                return state.name;
            }
        }
        return "";
    }
}
